This section describes how to use ddddmmmmIIIICCCC operations to find and create a
JPEG image converter for either encode (compression) or decode
(decompression) in realtime or non-realtime. (Realtime generally refers
to a JPEG converter that operates at video rate -- NTSC, PAL, or 601).
A JPEG image converter's DDDDMMMM____IIIICCCC____IIIIDDDD parameter -- from the DMparams list
returned by ddddmmmmIIIICCCCGGGGeeeettttDDDDeeeessssccccrrrriiiippppttttiiiioooonnnn -------- has the value ''''jjjjppppeeeegggg''''....
The DDDDMMMM____IIIICCCC____SSSSPPPPEEEEEEEEDDDD parameter will have the value DDDDMMMM____IIIICCCC____SSSSPPPPEEEEEEEEDDDD____RRRREEEEAAAALLLLTTTTIIIIMMMMEEEE if the
converter is capable of video rate processing. If the value is
DDDDMMMM____IIIICCCC____SSSSPPPPEEEEEEEEDDDD____NNNNOOOONNNNRRRREEEEAAAALLLLTTTTIIIIMMMMEEEE the converter is not capable of operating at
video rate.
The DDDDMMMM____IIIICCCC____CCCCOOOODDDDEEEE____DDDDIIIIRRRREEEECCCCTTTTIIIIOOOONNNN parameter indicates if the converter compresses
or decompresses. If the value is DDDDMMMM____IIIICCCC____CCCCOOOODDDDEEEE____DDDDIIIIRRRREEEECCCCTTTTIIIIOOOONNNN____DDDDEEEECCCCOOOODDDDEEEE then the
input to the converter is JPEG and the output is pixel data. If the
value is DDDDMMMM____IIIICCCC____CCCCOOOODDDDEEEE____DDDDIIIIRRRREEEECCCCTTTTIIIIOOOONNNN____EEEENNNNCCCCOOOODDDDEEEE then the input to the converter is
pixel data and the output is JPEG.
The following code fragment shows how to find a realtime JPEG decoder and
These sections describe how generic and JPEG-specific parameters are used
to control a JPEG converter. In general each parameter value should be
considered undefined until set explicitly by the program.
The input image format, the output image format and the conversion
operation are controlled using ddddmmmmIIIICCCCSSSSeeeettttSSSSrrrrccccPPPPaaaarrrraaaammmmssss,,,, ddddmmmmIIIICCCCSSSSeeeettttDDDDssssttttPPPPaaaarrrraaaammmmssss,,,, and,
The following discussion will use the terms ssssoooouuuurrrrcccceeee and ddddeeeessssttttiiiinnnnaaaattttiiiioooonnnn to
refer to the image format of the converter input and output,
respectively. The terms ccccoooommmmpppprrrreeeesssssssseeeedddd ssssiiiiddddeeee and uuuunnnnccccoooommmmpppprrrreeeesssssssseeeedddd ssssiiiiddddeeee will
generally refer to parameters of the source and destination respectively
if the converter is a JPEG decoder and vice versa if the converter is a
The image orientation, width, height, and pixel format must be set on
both the source and destination side of the converter. Use of
ddddmmmmSSSSeeeettttIIIImmmmaaaaggggeeeeDDDDeeeeffffaaaauuuullllttttssss is recommended to set the DDDDMMMM____IIIIMMMMAAAAGGGGEEEE____WWWWIIIIDDDDTTTTHHHH,,,,
DDDDMMMM____IIIIMMMMAAAAGGGGEEEE____HHHHEEEEIIIIGGGGHHHHTTTT,,,, and DDDDMMMM____IIIIMMMMAAAAGGGGEEEE____PPPPAAAACCCCKKKKIIIINNNNGGGG parameters. The width and height
on the compressed side must match the native size of the JPEG encoded
data. (A note on obtaining width and height for image data stored in a
movie file appears later in this man page.)
The DDDDMMMM____IIIIMMMMAAAAGGGGEEEE____CCCCOOOOMMMMPPPPRRRREEEESSSSSSSSIIIIOOOONNNN parameter must be set to DDDDMMMM____IIIIMMMMAAAAGGGGEEEE____JJJJPPPPEEEEGGGG on the
source or destination side as appropriate for the conversion direction.
All JPEG image converters support the DDDDMMMM____IIIIMMMMAAAAGGGGEEEE____PPPPAAAACCCCKKKKIIIINNNNGGGG____CCCCbbbbYYYYCCCCrrrrYYYY on the
compressed side. This is the same as the Video Library pixel packing for
4:2:2 video VVVVLLLL____PPPPAAAACCCCKKKKIIIINNNNGGGG____YYYYVVVVYYYYUUUU____444422222222____8888,,,, and is the same as the OpenGL
GGGGLLLL____YYYYCCCCRRRRCCCCBBBB____444422222222____SSSSGGGGIIIIXXXX format for use with ggggllllDDDDrrrraaaawwwwPPPPiiiixxxxeeeellllssss on some machines (O2,
The JPEG quality factor (a scaling of the quantization tables) is
controlled using the DDDDMMMM____IIIIMMMMAAAAGGGGEEEE____QQQQUUUUAAAALLLLIIIITTTTYYYY____SSSSPPPPAAAATTTTIIIIAAAALLLL parameter. The parameter
value ranges from 0.0 (lowest quality and most compression) to 1.0
(highest quality and least compression). Setting this control overrides
(erases) the converters internal setting for bitrate (if such had been
previously set by the program).
The compression ratio is controlled using DDDDMMMM____IIIIMMMMAAAAGGGGEEEE____BBBBIIIITTTTRRRRAAAATTTTEEEE.... Use of this
control erases the converter's internal setting of quality (if such had
been previously set by the program). The JPEG encoder destination
parameters for DM_IMAGE_RATE (frames per second) and DM_IMAGE_INTERLACING
(essentially indicating fields or frames) must be set explicitly by the
program to engage the rate control mechanism of the encoder. The actual
data rate acheived is "best effort" and may vary from image to image, but
the average will tend towards the desired value. All realtime encoders
are capable of acheiving an average rate in the range of 2 to 30
megabits/second. Some realtime encoders may be capable of higher rates.
Note that some _d_e_c_o_d_e_r_s have a maximum bitrate that is different than its
companion encoder.
It is recommended that the program set either the quality or bitrate
explicitly. If both DDDDMMMM____IIIIMMMMAAAAGGGGEEEE____BBBBIIIITTTTRRRRAAAATTTTEEEE and DDDDMMMM____IIIIMMMMAAAAGGGGEEEE____QQQQUUUUAAAALLLLIIIITTTTYYYY____SSSSPPPPAAAATTTTIIIIAAAALLLL
parameters are set then bitrate setting prevails and the quality setting
is used as the initial condition for the compressed image size.
The height of an image in the track is that of a full frame whether the
each image is stored as a field pair or a frame. If the track data is
interlaced then the appropriate value to use for the DM_IMAGE_HEIGHT
parameter with the image converter is half that of the value returned
from the movie file. That is, the Movie Library operates in terms of
full frames in contrast to ddddmmmmIIIICCCC and JPEG which operates only in terms of
images. A ddddmmmmIIIICCCC JPEG converter must therefore be informed of the exact
dimensions of the image. It's the program's responsibility to know
whether each image represents a field or a frame and to know the
dimensions in either case.
The mmmmvvvvIIIInnnnsssseeeerrrrttttTTTTrrrraaaacccckkkkDDDDaaaattttaaaaFFFFiiiieeeellllddddssss call is used when creating a Quicktime Motion
JPEG Type-A file of pairs of fields of JPEG encoded video. And, the
mmmmvvvvGGGGeeeettttTTTTrrrraaaacccckkkkDDDDaaaattttaaaaFFFFiiiieeeellllddddIIIInnnnffffoooo and mmmmvvvvRRRReeeeaaaaddddTTTTrrrraaaacccckkkkDDDDaaaattttaaaaFFFFiiiieeeellllddddssss calls are used to read